//
//  OMGSiteCollectionViewCell.m
//  A_project2.0
//
//  Created by apple on 16/3/15.
//  Copyright © 2016年 七平. All rights reserved.
//

#import "OMGSiteCollectionViewCell.h"

@implementation OMGSiteCollectionViewCell
//初始化
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
        //        _imgView.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_imgView];
        
        self.view = [[UIView alloc] init];
        //_view.backgroundColor =  [UIColor colorWithRed:85 / 255.0 green:85 / 255.0 blue:85 / 255.0 alpha:1];
        [_imgView addSubview:_view];
        
        self.cnnameLabel = [[UILabel alloc] init];
        //        _cnnameLabel.backgroundColor = [UIColor greenColor];
        [_imgView addSubview:_cnnameLabel];
        
        self.ennameLabel = [[UILabel alloc] init];
        //        _ennameLabel.backgroundColor = [UIColor greenColor];
        [_imgView addSubview:_ennameLabel];
        
        self.labelLabel = [[UILabel alloc] init];
        //        _labelLabel.backgroundColor = [UIColor yellowColor];
        [_view addSubview:_labelLabel];
        
        self.countLabel  = [[UILabel alloc] init];
        //        _countLabel.backgroundColor = [UIColor yellowColor];
        [_view addSubview:_countLabel];
        
        
    }
    return self;
    
    
}
#pragma mark - 布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _imgView.frame = CGRectMake(0, 0, layoutAttributes.size.width, layoutAttributes.size.height);
    _view.frame = CGRectMake(layoutAttributes.size.width / 2 + 14, 15, layoutAttributes.size.width / 2 - 17, layoutAttributes.size.width / 2 - 20);
    _countLabel.frame = CGRectMake(15, 5, 40, 30);
    _labelLabel.frame = CGRectMake(15, 30, 50, 25);
    _cnnameLabel.frame = CGRectMake(15, 200, 100, 30);
    _ennameLabel.frame = CGRectMake(13, 230, 100, 30);
}

@end
